VERSION 5.00
Begin VB.Form frmSetupPassword 
   BackColor       =   &H00FFFFFF&
   Caption         =   "Enter Password"
   ClientHeight    =   1575
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   Icon            =   "frmSetupPassword.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   1575
   ScaleWidth      =   4680
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdCancel 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "&Cancel"
      Height          =   315
      Left            =   2640
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1080
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdContinue 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "C&ontinue"
      Height          =   315
      Left            =   840
      MaskColor       =   &H00E0E0E0&
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   1080
      Width           =   1215
   End
   Begin VB.TextBox txtPassword 
      Height          =   315
      IMEMode         =   3  'DISABLE
      Left            =   1140
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   600
      Width           =   2295
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      Caption         =   "Please enter password."
      Height          =   195
      Left            =   480
      TabIndex        =   4
      Top             =   360
      Width           =   3735
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      Caption         =   "Restricted Access."
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   195
      Left            =   480
      TabIndex        =   3
      Top             =   120
      Width           =   3735
   End
End
Attribute VB_Name = "frmSetupPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'---------------------------------------------------------------------------------------
' Procedure : cmdCancel_Click()
' DateTime  : 7/14/2004
' Purpose   : Hide the form and clear the password
'---------------------------------------------------------------------------------------
'
Private Sub cmdCancel_Click()
    On Error GoTo EH
    
    txtPassword.SetFocus
    txtPassword = ""
    Me.Hide
    If frmShip.Visible Then frmShip.SetFocus
    
    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmSetupPassword.cmdCancel_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdContinue_Click()
' DateTime  : 7/14/2004
' Purpose   : If the admin or NASCAR11 passwords are entered show everything, if the
'             Level2 password is entered show only the items selected on the Password
'             tab in setup, else show message.
'---------------------------------------------------------------------------------------
'
Private Sub cmdContinue_Click()
    
    On Error GoTo EH
    
    With frmSetup
        Select Case txtPassword
            Case "NASCAR11", .txtAdminPswd
                Call SetAdminLevel
                Me.Hide
            Case .txtLevel2Pswd
                Call SetLevel2
                Me.Hide
            Case Else
                MsgBox "Invalid Password", vbExclamation, "Access Denied"
                txtPassword.SetFocus
        End Select
    End With
    
    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmSetupPassword.cmdContinue_Click"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : SetAdminLevel()
' DateTime  : 7/14/2004
' Purpose   : Enable all tabs on Setup form
'---------------------------------------------------------------------------------------
'
Private Sub SetAdminLevel()
    Dim i As Integer
    
    On Error GoTo EH
    
    With frmSetup
        For i = 0 To .SSTab1.Tabs - 1
            .SSTab1.TabEnabled(i) = True
        Next
       .SSTab1.Tab = 0
       .Show vbModeless, frmShip
    End With

    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmSetupPassword.SetAdminLevel"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : SetLevel2()
' DateTime  : 7/14/2004
' Purpose   : Enable only checked items on Setup form Password tab. Always disable
'             Password tab for Level 2.
'---------------------------------------------------------------------------------------
'
Private Sub SetLevel2()
    Dim i As Integer
    
    On Error GoTo EH
    
    With frmSetup
        For i = .SSTab1.Tabs - 2 To 0 Step -1
            If .chkLevel2Access(i) = 1 Then
                .SSTab1.TabEnabled(i) = True
                .SSTab1.Tab = i
            Else
                .SSTab1.TabEnabled(i) = False
            End If
        Next
        .SSTab1.TabEnabled(.SSTab1.Tabs - 1) = False
        .Show vbModeless, frmShip
    End With
    
    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmSetupPassword.SetLevel2"

End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_Activate()
' DateTime  : 5/4/2006
' Purpose   : Set Focus to Password field and clear
'---------------------------------------------------------------------------------------
'
Private Sub Form_Activate()
    txtPassword.SetFocus
    txtPassword = ""
End Sub

'---------------------------------------------------------------------------------------
' Procedure : Form_KeyDown()
' DateTime  : 2/17/2005
' Purpose   : Enter key pressed sends a TAB to move to next field
'---------------------------------------------------------------------------------------
'
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If Not TypeOf Me.ActiveControl Is CommandButton Then
        If Shift = 0 And KeyCode = 13 Then
            'SendKeys "{TAB}"
            Call cmdContinue_Click
        End If
    End If
End Sub

Private Sub txtPassword_GotFocus()
    Call SelectAllText(txtPassword)
End Sub
